<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.14"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>tmr_manager: xtmr_manager_intr_example.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="HTML_custom.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="xlogo_bg.gif"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">tmr_manager
   </div>
   <div id="projectbrief">Xilinx SDK Drivers API Documentation</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.14 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',false,false,'search.php','Search');
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('xtmr__manager__intr__example_8c.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">xtmr_manager_intr_example.c File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">Overview</h2>
<div class="textblock"><p>This file contains a design example using the TMRManager driver (XTMRManager) and hardware device using the interrupt mode. </p>
<dl class="section note"><dt>Note</dt><dd></dd></dl>
<p>The user must provide a physical loopback such that data which is transmitted will be received.</p>
<p>MODIFICATION HISTORY: </p><pre>
Ver   Who  Date     Changes
<hr/>

1.0   sa   04/05/17 First release
</pre> </div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:afbd883c8cd605377457fc9a7113f2e87"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xtmr__manager__intr__example_8c.html#afbd883c8cd605377457fc9a7113f2e87">TMRManagerIntrExample</a> (u16 DeviceId)</td></tr>
<tr class="memdesc:afbd883c8cd605377457fc9a7113f2e87"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function does a minimal test on the TMRManager device and driver as a design example.  <a href="#afbd883c8cd605377457fc9a7113f2e87">More...</a><br /></td></tr>
<tr class="separator:afbd883c8cd605377457fc9a7113f2e87"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a48db4794ee2928735727be2521a5fa56"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xtmr__manager__intr__example_8c.html#a48db4794ee2928735727be2521a5fa56">SetupInterruptSystem</a> (XTMRManager *TMRManagerPtr)</td></tr>
<tr class="memdesc:a48db4794ee2928735727be2521a5fa56"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function setups the interrupt system such that interrupts can occur for the TMRManager device.  <a href="#a48db4794ee2928735727be2521a5fa56">More...</a><br /></td></tr>
<tr class="separator:a48db4794ee2928735727be2521a5fa56"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a60e3b0776621ce45f55d94b0fb959ff1"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xtmr__manager__intr__example_8c.html#a60e3b0776621ce45f55d94b0fb959ff1">SendHandler</a> (void *CallBackRef, unsigned int EventData)</td></tr>
<tr class="memdesc:a60e3b0776621ce45f55d94b0fb959ff1"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function is the handler which performs processing to send data to the TMRManager.  <a href="#a60e3b0776621ce45f55d94b0fb959ff1">More...</a><br /></td></tr>
<tr class="separator:a60e3b0776621ce45f55d94b0fb959ff1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a964ea960d8251912f79e5a9fa9600f3e"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xtmr__manager__intr__example_8c.html#a964ea960d8251912f79e5a9fa9600f3e">RecvHandler</a> (void *CallBackRef, unsigned int EventData)</td></tr>
<tr class="memdesc:a964ea960d8251912f79e5a9fa9600f3e"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function is the handler which performs processing to receive data from the TMRManager.  <a href="#a964ea960d8251912f79e5a9fa9600f3e">More...</a><br /></td></tr>
<tr class="separator:a964ea960d8251912f79e5a9fa9600f3e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a840291bc02cba5474a4cb46a9b9566fe"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xtmr__manager__intr__example_8c.html#a840291bc02cba5474a4cb46a9b9566fe">main</a> (void)</td></tr>
<tr class="memdesc:a840291bc02cba5474a4cb46a9b9566fe"><td class="mdescLeft">&#160;</td><td class="mdescRight">Main function to call the TMRManager interrupt example.  <a href="#a840291bc02cba5474a4cb46a9b9566fe">More...</a><br /></td></tr>
<tr class="separator:a840291bc02cba5474a4cb46a9b9566fe"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a id="a840291bc02cba5474a4cb46a9b9566fe"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a840291bc02cba5474a4cb46a9b9566fe">&#9670;&nbsp;</a></span>main()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int main </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Main function to call the TMRManager interrupt example. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">None</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>XST_SUCCESS if successful, XST_FAILURE if unsuccessful</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None </dd></dl>

<p class="reference">References <a class="el" href="xtmr__manager__intr__example_8c.html#afbd883c8cd605377457fc9a7113f2e87">TMRManagerIntrExample()</a>.</p>

</div>
</div>
<a id="a964ea960d8251912f79e5a9fa9600f3e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a964ea960d8251912f79e5a9fa9600f3e">&#9670;&nbsp;</a></span>RecvHandler()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void RecvHandler </td>
          <td>(</td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>CallBackRef</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>EventData</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function is the handler which performs processing to receive data from the TMRManager. </p>
<p>It is called from an interrupt context such that the amount of processing performed should be minimized. It is called data is present in the receive FIFO of the TMRManager such that the data can be retrieved from the TMRManager. The size of the data present in the FIFO is not known when this function is called.</p>
<p>This handler provides an example of how to handle data for the TMRManager, but is application specific.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">CallBackRef</td><td>contains a callback reference from the driver, in this case it is the instance pointer for the TMRManager driver. </td></tr>
    <tr><td class="paramname">EventData</td><td>contains the number of bytes sent or received for sent and receive events.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

</div>
</div>
<a id="a60e3b0776621ce45f55d94b0fb959ff1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a60e3b0776621ce45f55d94b0fb959ff1">&#9670;&nbsp;</a></span>SendHandler()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void SendHandler </td>
          <td>(</td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>CallBackRef</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>EventData</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function is the handler which performs processing to send data to the TMRManager. </p>
<p>It is called from an interrupt context such that the amount of processing performed should be minimized. It is called when the transmit FIFO of the TMRManager is empty and more data can be sent through the TMRManager.</p>
<p>This handler provides an example of how to handle data for the TMRManager, but is application specific.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">CallBackRef</td><td>contains a callback reference from the driver. In this case it is the instance pointer for the TMRManager driver. </td></tr>
    <tr><td class="paramname">EventData</td><td>contains the number of bytes sent or received for sent and receive events.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

</div>
</div>
<a id="a48db4794ee2928735727be2521a5fa56"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a48db4794ee2928735727be2521a5fa56">&#9670;&nbsp;</a></span>SetupInterruptSystem()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int SetupInterruptSystem </td>
          <td>(</td>
          <td class="paramtype">XTMRManager *&#160;</td>
          <td class="paramname"><em>TMRManagerPtr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function setups the interrupt system such that interrupts can occur for the TMRManager device. </p>
<p>This function is application specific since the actual system may or may not have an interrupt controller. The TMRManager could be directly connected to a processor without an interrupt controller. The user should modify this function to fit the application.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">TMRManagerPtr</td><td>contains a pointer to the instance of the TMRManager component which is going to be connected to the interrupt controller.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>XST_SUCCESS if successful, otherwise XST_FAILURE.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

</div>
</div>
<a id="afbd883c8cd605377457fc9a7113f2e87"></a>
<h2 class="memtitle"><span class="permalink"><a href="#afbd883c8cd605377457fc9a7113f2e87">&#9670;&nbsp;</a></span>TMRManagerIntrExample()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int TMRManagerIntrExample </td>
          <td>(</td>
          <td class="paramtype">u16&#160;</td>
          <td class="paramname"><em>DeviceId</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function does a minimal test on the TMRManager device and driver as a design example. </p>
<p>The purpose of this function is to illustrate how to use the XTMRManager component.</p>
<p>This function sends data and expects to receive the same data through the TMRManager. The user must provide a physical loopback such that data which is transmitted will be received.</p>
<p>This function uses interrupt driver mode of the TMRManager device. The calls to the TMRManager driver in the handlers should only use the non-blocking calls.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">DeviceId</td><td>is the Device ID of the TMRManager Device and is the XPAR_&lt;tmr_manager_instance&gt;_DEVICE_ID value from xparameters.h.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>XST_SUCCESS if successful, otherwise XST_FAILURE.</dd></dl>
<dl class="section note"><dt>Note</dt><dd></dd></dl>
<p>This function contains an infinite loop such that if interrupts are not working it may never return. </p>

<p class="reference">Referenced by <a class="el" href="xtmr__manager__intr__example_8c.html#a840291bc02cba5474a4cb46a9b9566fe">main()</a>.</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Copyright &copy; 2015 Xilinx Inc. All rights reserved.</li>
  </ul>
</div>
</body>
</html>
